using System;
using System.Net;
using System.Threading;
using System.Reflection;
using System.Diagnostics;

using System.Security;
using System.Security.Principal;

namespace CodePlex.Diagnostics
{
    /// <summary>
    /// Provides additional contextual information to be published along with the <see cref="T:System.String"/> representing a log entry.
    /// </summary>
    [Serializable]
    public sealed class LoggingContext : ContextBase
    {
        #region LoggingContext Private Fields

        private string m_entry;

        private LoggingPriority m_priority;
        
        private LoggingType m_type;

        #endregion

        #region public LoggingContext(string entry, Assembly assembly, LoggingPriority priority, LoggingType type, IIdentity identity) : base(assembly, appDomain)

        /// <summary>
        /// Initializes a new instance of the <see cref="T:LoggingContext"/> class.    
        /// </summary>
        /// <param name="entry">The <see cref="T:System.String"/> to be published.</param>
        /// <param name="assembly">The <see cref="T:System.Reflection.Assembly"/> within which the logging provider was called.</param>
        /// <param name="process">The <see cref="T:System.Diagnostics.Process"/> within which the logging provider was called.</param>
        /// <param name="thread">The <see cref="T:System.Threading.Thread"/> within which the logging provider was called.</param>
        /// <param name="priority">The <see cref="T:CodePlex.Diagnostics.LoggingPriority"/> of the specified log entry.</param>
        /// <param name="type">The <see cref="T:CodePlex.Diagnostics.LoggingType"/> of the specified log entry.</param>
        /// <param name="identity">The <see cref="T:System.Security.Principal.IIdentity"/> to associate with this log entry.</param>
        /// <param name="appDomain">The <see cref="T:System.AppDomain"/> within which the logging provider was called.</param>
        public LoggingContext(string entry, Assembly assembly, Process process, Thread thread, LoggingPriority priority, LoggingType type, IIdentity identity, AppDomain appDomain) : base(assembly, appDomain, thread, process, identity)
        {
            m_entry = entry;
            m_priority = priority;
            m_type = type;
        }

        #endregion

        #region public string Entry

        /// <summary>
        /// Gets or sets the entry to be published.
        /// </summary>
        /// <value>The entry to be published.</value>
        public string Entry
        {
            get
            {
                return m_entry;
            }
        }

        #endregion

        #region public LoggingPriority Priority

        /// <summary>
        /// Gets or sets the <see cref="T:CodePlex.Diagnostics.LoggingPriority"/> of the log entry to be published.
        /// </summary>
        /// <value>The <see cref="T:CodePlex.Diagnostics.LoggingPriority"/> of the log entry to be published.</value>
        public LoggingPriority Priority
        {
            get
            {
                return m_priority;
            }
        }

        #endregion

        #region public LoggingType LoggingType

        /// <summary>
        /// Gets or sets the <see cref="T:CodePlex.Diagnostics.LoggingType"/> of the log entry to be published.
        /// </summary>
        /// <value>The <see cref="T:CodePlex.Diagnostics.LoggingType"/> of the log entry to be published.</value>
        public LoggingType LoggingType
        {
            get
            {
                return m_type;
            }
        }

        #endregion
    }
}
